package com.suxin.ratelimit.v2;

import com.suxin.ratelimit.v2.config.RateLimitSelector;
import org.springframework.context.annotation.Import;

import java.lang.annotation.*;

/**
 * @author Tang
 * @classname EnableRateLimit
 * @description [  ]
 * @date 2022/2/9 16:00
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import(value = {RateLimitSelector.class})
public @interface EnableRateLimit {

    /**
     * 限流类型
     * @return
     */
    Type type() default Type.STAND;

    enum Type {
        /**
         * 单机限流
         */
        STAND,
        /**
         * 分布式限流
         */
        DISTRIBUTED
    }

}
